package Shapes;
import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 23735
 * Date: 2022-12-16
 * Time: 13:58
 */

/**
 * 椭圆
 */
public class Oval extends Shape{
    public Oval(int x1, int y1, int x2, int y2,Color color,int size){
        super(x1,y1,x2,y2,color,size);
    }

    //重写父类的draw方法
    @Override
    public void draw(Graphics graphics) {
        super.draw(graphics);
        super.graphics2D.drawOval(Math.min(x1,x2),Math.min(y1,y2), Math.abs(x1-x2), Math.abs(y1-y2));
    }
}
